Skip to content

feat: add Maple AI provider integration#10436

Open
marksftw wants to merge 4 commits intoanomalyco:devfrom
marksftw:feature/add-maple-ai-provider
Open

feat: add Maple AI provider integration#10436
marksftw wants to merge 4 commits intoanomalyco:devfrom
marksftw:feature/add-maple-ai-provider

Conversation

@marksftw
Copy link
Copy Markdown

@marksftw marksftw commented Jan 24, 2026

Fixes #10434

What does this PR do?

Adds Maple AI as a first-class provider with dynamic model discovery.

  • Provider dynamically fetches models from running Maple proxy
  • Supports API key authentication (stored in auth.json)
  • Configurable baseURL (default: http://127.0.0.1:8080/v1)
  • Helpful setup instructions in both CLI and TUI
  • Placed in 'Other' category
  • Gracefully handles proxy unavailability (no models shown)

Users run /connect to add their Maple API key, then /models to see available models fetched directly from their Maple proxy.

Generalized model discovery

The existing model discovery infrastructure was hardcoded to only run for GitLab. This PR refactors the discovery loop to be generic — it now iterates over all providers that return a discoverModels function from their custom loader, rather than special-casing a single provider. Maple uses this same discoverModels hook, so no new discovery mechanism was needed.

This means any future provider that needs runtime model discovery can simply return a discoverModels function and the framework handles the rest (calling it, merging results, error logging, setting providerID).

How did you verify your code works?

Tested locally with my Maple account. Confirmed provider selection, API key configuration, and chat completion requests work correctly. In fact, most of this code change was built using OpenCode connected to Maple.

@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potentially Related PRs Found

While no exact duplicates of PR #10436 were found, there are related PRs that implement similar functionality for other providers:

  1. PR feat(opencode): add auto model detection for OpenAI-compatible providers #8359 - feat(opencode): add auto model detection for OpenAI-compatible providers

    • Implements automatic model detection for OpenAI-compatible providers, which is the same core functionality as the Maple AI integration's dynamic model discovery
  2. PR feat(opencode): added logic to probe loaded models from lmstudio and ollama #8748 - feat(opencode): added logic to probe loaded models from lmstudio and ollama

    • Similar approach to dynamically fetch available models from local providers
  3. PR Fetch from model list from /v1/models/ from OpenAI Compatible APIs #3427 - Fetch from model list from /v1/models/ from OpenAI Compatible APIs

    • Related to fetching models from OpenAI-compatible APIs using the /v1/models/ endpoint

These PRs share the same architectural pattern of dynamic model discovery from a provider endpoint, which is the core innovation in the Maple AI provider integration. You may want to review how these implementations handle error cases and model caching to ensure consistency across all providers.

@marksftw
Copy link
Copy Markdown
Author

I don't think this PR is directly dependent on those PR's referenced by the GitHub action.

@marksftw
Copy link
Copy Markdown
Author

marksftw commented Feb 4, 2026

Would love to get this merged in soon as a strong privacy and security option for users. Especially on a day like today when Claude goes down :)

@marksftw marksftw force-pushed the feature/add-maple-ai-provider branch from d4ec936 to ae7d92c Compare April 9, 2026 03:49
@marksftw marksftw force-pushed the feature/add-maple-ai-provider branch from ba93bb7 to d421ab4 Compare April 18, 2026 03:59
@marksftw
Copy link
Copy Markdown
Author

Keeping this PR current with latest from dev. Happy to answer any questions about the implementation and Maple.

@marksftw marksftw force-pushed the feature/add-maple-ai-provider branch from d421ab4 to 8918fb1 Compare April 23, 2026 16:36
@marksftw marksftw requested a review from adamdotdevin as a code owner April 23, 2026 16:36
@marksftw marksftw force-pushed the feature/add-maple-ai-provider branch from 1f42c2b to 0f7b5c6 Compare April 23, 2026 17:12
@marksftw marksftw marked this pull request as draft April 23, 2026 17:13
@marksftw marksftw force-pushed the feature/add-maple-ai-provider branch from 0f7b5c6 to 1f42c2b Compare April 23, 2026 17:15
@marksftw marksftw force-pushed the feature/add-maple-ai-provider branch from 1f42c2b to c518fbd Compare April 23, 2026 17:24
marksftw and others added 2 commits April 23, 2026 12:24
Replace the hardcoded GitLab discovery block with a generic loop over
all discoveryLoaders entries. Refactor Maple to use the existing
discoverModels hook instead of inline fetching.
@marksftw marksftw marked this pull request as ready for review April 23, 2026 18:43
@marksftw
Copy link
Copy Markdown
Author

hey @adamdotdevin and @thdxr, I've been keeping this PR up to date with dev. Just pushed an update today that generalizes the model discovery loop to handle both GitLab and Maple. I know there are a lot of PRs to review, so would definitely appreciate if this one got a look sometime soon. We have many users running Maple with OpenCode but it's a manual process to set up. This would make it much smoother by being included in the provider list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add Maple AI (private TEE) to the providers list

1 participant